package com.gt.wxpay.cashier.domain.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.JdbcType;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("cashier_payment")
public class CashierPayment extends BaseEntity {

    private static final long serialVersionUID = -7523338490606468272L;

    /**
     * 退款原因
     */


    @TableField(value = "refund_reason")
    private String refundReason;


    /**
     * 系统的AppKey
     */
    @TableField(value = "system_key")
    private String systemKey;

    /**
     * 商品名称
     */
    @TableField(value = "goods_name")
    private String goodsName;
    /**
     * 商户手续费
     */
    @TableField(value = "merchant_fee", jdbcType = JdbcType.DECIMAL)
    private BigDecimal merchantFee;
    /**
     * 支付订单号
     */

    @TableField(value = "payment_no")
    private String paymentNo;
    /**
     * 交易类型
     */


    @TableField(value = "transaction_type", jdbcType = JdbcType.NUMERIC)
    private Integer transactionType;


    /**
     * 支付状态（-1-已取消，10-未支付，11-支付中，12-已支付，20-退款中，21-已退款）
     */

    @TableField(value = "status", jdbcType = JdbcType.NUMERIC)
    private Integer status;
    /**
     * 交易金额，单位为分。
     */

    @TableField(value = "amount", jdbcType = JdbcType.NUMERIC)
    private Long amount;
    /**
     * 币种
     */

    @TableField(value = "currency_type")
    private String currencyType;
    /**
     * 付款方Id
     */

    @TableField(value = "payer_id", jdbcType = JdbcType.DECIMAL)
    private Long payerId;
    /**
     * 付款方名称
     */


    @TableField(value = "payer_name")
    private String payerName;
    /**
     * 商户id
     */


    @TableField(value = "merchant_id")
    private String merchantId;

    /**
     * 支付渠道Id 枚举：
     * 微信支付，支付宝支付
     */

    @TableField(value = "pay_channel_id")
    private String payChannelId;


    /**
     * 退款受理时间
     */
    @TableField(value = "channel_refund_create_time", jdbcType = JdbcType.TIMESTAMP)
    private LocalDateTime channelRefundCreateTime;


    /**
     * SUCCESS: 退款成功CLOSED: 退款关闭PROCESSING: 退款处理中ABNORMAL: 退款异常
     */
    @TableField(value = "channel_refund_status")
    private String channelRefundStatus;

    /**
     * 退款成功时间，退款状态status为SUCCESS（退款成功）时，返回该字段
     */
    @TableField(value = "channel_refund_success_time", jdbcType = JdbcType.TIMESTAMP)
    private Date channelRefundSuccessTime;

    /**
     * 【退款渠道】 退款渠道ORIGINAL: 原路退款BALANCE: 退回到余额
     */
    @TableField(value = "channel_refund_type")
    private String channelRefundType;


    /**
     * 【资金账户】 退款所使用资金对应的资金账户类型
     */
    @TableField(value = "channel_refund_funds_account")
    private String channelRefundFundsAccount;


    /**
     * 【退款入账账户】 取当前退款单的退款入账方
     */
    @TableField(value = "channel_refund_user_received_account")
    private String channelRefundUserReceivedAccount;

    private String payChannel;

    /**
     * 支付成功金额
     */


    @TableField(value = "success_amount", jdbcType = JdbcType.NUMERIC)
    private Long successAmount;
    /**
     * 支付成功时间
     */

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "success_time", jdbcType = JdbcType.TIMESTAMP)
    private Date successTime;
    /**
     * 支付结果通知url
     */


    @TableField(value = "notify_url")
    private String notifyUrl;
    /**
     * 渠道支付类型
     * channelPayType	是	字符串	枚举：
     * JSAPI, NATIVE
     */
    @TableField(value = "channel_pay_type")
    private String channelPayType;
    /**
     * 渠道支付返回流水号
     */


    @TableField(value = "channel_flow_no")
    private String channelFlowNo;
    /**
     * 渠道支付返回结果码
     */


    @TableField(value = "channel_return_code")
    private String channelReturnCode;
    /**
     * 渠道支付返回的结果信息
     */


    @TableField(value = "channel_return_message")
    private String channelReturnMessage;
    /**
     * 客户请求ip
     */


    @TableField(value = "client_ip")
    private String clientIp;
    /**
     * 描述
     */


    @TableField(value = "description")
    private String description;
    /**
     * 对账金额
     */


    @TableField(value = "check_amount", jdbcType = JdbcType.DECIMAL)
    private BigDecimal checkAmount;
    /**
     * 对账日期
     */

    @JSONField(format = "yyyy-MM-dd")
    @TableField(value = "check_time", jdbcType = JdbcType.TIMESTAMP)
    private Date checkTime;
    /**
     * 对账状态（-1-帐不平，0-未对账，1-帐平）
     */


    @TableField(value = "check_status", jdbcType = JdbcType.NUMERIC)
    private Integer checkStatus;

    /**
     * SUCCESS(1, "退款成功"),
     * CLOSED(2, "退款关闭"),
     * PROCESSING(3, "退款处理中"),
     * ABNORMAL(4, "退款异常");
     */
    @TableField(value = "merchant_refund_status", jdbcType = JdbcType.NUMERIC)
    private Integer merchantRefundStatus;
    /**
     * 结算金额
     */


    @TableField(value = "settle_amount", jdbcType = JdbcType.NUMERIC)
    private Long settleAmount;
    /**
     * 结算状态
     */


    @TableField(value = "settle_status", jdbcType = JdbcType.NUMERIC)
    private Integer settleStatus;
    /**
     * 结算日期
     */

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "settle_date", jdbcType = JdbcType.TIMESTAMP)
    private Date settleDate;
    /**
     * 退款金额
     */


    @TableField(value = "refund_amount", jdbcType = JdbcType.NUMERIC)
    private Long refundAmount;
    /**
     * 退款日期
     */

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "refund_time", jdbcType = JdbcType.TIMESTAMP)
    private Date refundTime;
    /**
     * 渠道退款流水号
     */


    @TableField(value = "channel_refund_flow_no")
    private String channelRefundFlowNo;
    /**
     * 渠道退款结果码
     */


    @TableField(value = "channel_refund_result_code")
    private String channelRefundResultCode;
    /**
     * 渠道退款结果信息
     */


    @TableField(value = "channel_refund_result_message")
    private String channelRefundResultMessage;
    /**
     * 公众号、小程序id
     */


    @TableField(value = "app_id")
    private String appId;
    /**
     * 交易订单号
     */


    @TableField(value = "order_no")
    private String orderNo;
    /**
     * 渠道手续费
     */


    @TableField(value = "channel_service_fee", jdbcType = JdbcType.DECIMAL)
    private BigDecimal channelServiceFee;


    private String userId;

    private String codeUrl;

    /**
     * 小程序支付传openId。
     */
    private String openId;

    /**
     * 手机号
     */
    private String phoneNo;
    private String refundNotifyUrl;

    /**
     * 字符串	商品类型：
     * ARGUIDE-ar导览
     * ACTIVITY- 活动
     */
    private String goodsType;

    private String goodsDesc;


    public String getRefundReason() {
        return refundReason;
    }

    public void setRefundReason(String refundReason) {
        this.refundReason = refundReason;
    }

    public String getSystemKey() {
        return systemKey;
    }

    public void setSystemKey(String systemKey) {
        this.systemKey = systemKey;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public BigDecimal getMerchantFee() {
        return merchantFee;
    }

    public void setMerchantFee(BigDecimal merchantFee) {
        this.merchantFee = merchantFee;
    }

    public String getPaymentNo() {
        return paymentNo;
    }

    public void setPaymentNo(String paymentNo) {
        this.paymentNo = paymentNo;
    }

    public Integer getTransactionType() {
        return transactionType;
    }

    public void setTransactionType(Integer transactionType) {
        this.transactionType = transactionType;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getAmount() {
        return amount;
    }

    public void setAmount(Long amount) {
        this.amount = amount;
    }

    public String getCurrencyType() {
        return currencyType;
    }

    public void setCurrencyType(String currencyType) {
        this.currencyType = currencyType;
    }

    public Long getPayerId() {
        return payerId;
    }

    public void setPayerId(Long payerId) {
        this.payerId = payerId;
    }

    public String getPayerName() {
        return payerName;
    }

    public void setPayerName(String payerName) {
        this.payerName = payerName;
    }

    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    public String getPayChannelId() {
        return payChannelId;
    }

    public void setPayChannelId(String payChannelId) {
        this.payChannelId = payChannelId;
    }

    public LocalDateTime getChannelRefundCreateTime() {
        return channelRefundCreateTime;
    }

    public void setChannelRefundCreateTime(LocalDateTime channelRefundCreateTime) {
        this.channelRefundCreateTime = channelRefundCreateTime;
    }

    public String getChannelRefundStatus() {
        return channelRefundStatus;
    }

    public void setChannelRefundStatus(String channelRefundStatus) {
        this.channelRefundStatus = channelRefundStatus;
    }

    public Date getChannelRefundSuccessTime() {
        return channelRefundSuccessTime;
    }

    public void setChannelRefundSuccessTime(Date channelRefundSuccessTime) {
        this.channelRefundSuccessTime = channelRefundSuccessTime;
    }

    public String getChannelRefundType() {
        return channelRefundType;
    }

    public void setChannelRefundType(String channelRefundType) {
        this.channelRefundType = channelRefundType;
    }

    public String getChannelRefundFundsAccount() {
        return channelRefundFundsAccount;
    }

    public void setChannelRefundFundsAccount(String channelRefundFundsAccount) {
        this.channelRefundFundsAccount = channelRefundFundsAccount;
    }

    public String getChannelRefundUserReceivedAccount() {
        return channelRefundUserReceivedAccount;
    }

    public void setChannelRefundUserReceivedAccount(String channelRefundUserReceivedAccount) {
        this.channelRefundUserReceivedAccount = channelRefundUserReceivedAccount;
    }

    public String getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(String payChannel) {
        this.payChannel = payChannel;
    }

    public Long getSuccessAmount() {
        return successAmount;
    }

    public void setSuccessAmount(Long successAmount) {
        this.successAmount = successAmount;
    }

    public Date getSuccessTime() {
        return successTime;
    }

    public void setSuccessTime(Date successTime) {
        this.successTime = successTime;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getChannelPayType() {
        return channelPayType;
    }

    public void setChannelPayType(String channelPayType) {
        this.channelPayType = channelPayType;
    }

    public String getChannelFlowNo() {
        return channelFlowNo;
    }

    public void setChannelFlowNo(String channelFlowNo) {
        this.channelFlowNo = channelFlowNo;
    }

    public String getChannelReturnCode() {
        return channelReturnCode;
    }

    public void setChannelReturnCode(String channelReturnCode) {
        this.channelReturnCode = channelReturnCode;
    }

    public String getChannelReturnMessage() {
        return channelReturnMessage;
    }

    public void setChannelReturnMessage(String channelReturnMessage) {
        this.channelReturnMessage = channelReturnMessage;
    }

    public String getClientIp() {
        return clientIp;
    }

    public void setClientIp(String clientIp) {
        this.clientIp = clientIp;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public BigDecimal getCheckAmount() {
        return checkAmount;
    }

    public void setCheckAmount(BigDecimal checkAmount) {
        this.checkAmount = checkAmount;
    }

    public Date getCheckTime() {
        return checkTime;
    }

    public void setCheckTime(Date checkTime) {
        this.checkTime = checkTime;
    }

    public Integer getCheckStatus() {
        return checkStatus;
    }

    public void setCheckStatus(Integer checkStatus) {
        this.checkStatus = checkStatus;
    }

    public Long getSettleAmount() {
        return settleAmount;
    }

    public void setSettleAmount(Long settleAmount) {
        this.settleAmount = settleAmount;
    }

    public Integer getSettleStatus() {
        return settleStatus;
    }

    public void setSettleStatus(Integer settleStatus) {
        this.settleStatus = settleStatus;
    }

    public Date getSettleDate() {
        return settleDate;
    }

    public void setSettleDate(Date settleDate) {
        this.settleDate = settleDate;
    }

    public Long getRefundAmount() {
        return refundAmount;
    }

    public void setRefundAmount(Long refundAmount) {
        this.refundAmount = refundAmount;
    }

    public Date getRefundTime() {
        return refundTime;
    }

    public void setRefundTime(Date refundTime) {
        this.refundTime = refundTime;
    }

    public String getChannelRefundFlowNo() {
        return channelRefundFlowNo;
    }

    public void setChannelRefundFlowNo(String channelRefundFlowNo) {
        this.channelRefundFlowNo = channelRefundFlowNo;
    }

    public String getChannelRefundResultCode() {
        return channelRefundResultCode;
    }

    public void setChannelRefundResultCode(String channelRefundResultCode) {
        this.channelRefundResultCode = channelRefundResultCode;
    }

    public String getChannelRefundResultMessage() {
        return channelRefundResultMessage;
    }

    public void setChannelRefundResultMessage(String channelRefundResultMessage) {
        this.channelRefundResultMessage = channelRefundResultMessage;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public BigDecimal getChannelServiceFee() {
        return channelServiceFee;
    }

    public void setChannelServiceFee(BigDecimal channelServiceFee) {
        this.channelServiceFee = channelServiceFee;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getCodeUrl() {
        return codeUrl;
    }

    public void setCodeUrl(String codeUrl) {
        this.codeUrl = codeUrl;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getPhoneNo() {
        return phoneNo;
    }

    public void setPhoneNo(String phoneNo) {
        this.phoneNo = phoneNo;
    }

    public String getRefundNotifyUrl() {
        return refundNotifyUrl;
    }

    public void setRefundNotifyUrl(String refundNotifyUrl) {
        this.refundNotifyUrl = refundNotifyUrl;
    }

    public String getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(String goodsType) {
        this.goodsType = goodsType;
    }

    public String getGoodsDesc() {
        return goodsDesc;
    }

    public void setGoodsDesc(String goodsDesc) {
        this.goodsDesc = goodsDesc;
    }
}
